load("@rules_python//python:defs.bzl", "py_library", "py_test")
load("@tink_py_pip_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

py_library(
    name = "hybrid",
    srcs = ["__init__.py"],
    srcs_version = "PY3",
    visibility = ["//visibility:public"],
    deps = [
        ":_hybrid_decrypt",
        ":_hybrid_encrypt",
        ":_hybrid_key_manager",
        ":_hybrid_key_templates",
        ":_hybrid_wrapper",
    ],
)

py_library(
    name = "_hybrid_decrypt",
    srcs = ["_hybrid_decrypt.py"],
    srcs_version = "PY3",
)

py_library(
    name = "_hybrid_encrypt",
    srcs = ["_hybrid_encrypt.py"],
    srcs_version = "PY3",
)

py_library(
    name = "_hybrid_key_manager",
    srcs = ["_hybrid_key_manager.py"],
    srcs_version = "PY3",
    deps = [
        ":_hybrid_decrypt",
        ":_hybrid_encrypt",
        ":_hybrid_wrapper",
        "//tink/cc/pybind:tink_bindings",
        "//tink/core",
    ],
)

py_test(
    name = "_hybrid_key_manager_test",
    srcs = ["_hybrid_key_manager_test.py"],
    srcs_version = "PY3",
    deps = [
        ":hybrid",
        requirement("absl-py"),
        "//tink:tink_python",
        "//tink/aead",
        "//tink/core",
        "//tink/proto:common_py_pb2",
        "//tink/proto:ecies_aead_hkdf_py_pb2",
        "//tink/proto:hpke_py_pb2",
        "//tink/proto:tink_py_pb2",
    ],
)

py_library(
    name = "_hybrid_wrapper",
    srcs = ["_hybrid_wrapper.py"],
    srcs_version = "PY3",
    deps = [
        ":_hybrid_decrypt",
        ":_hybrid_encrypt",
        "//tink/core",
    ],
)

py_test(
    name = "_hybrid_wrapper_test",
    srcs = ["_hybrid_wrapper_test.py"],
    srcs_version = "PY3",
    deps = [
        ":hybrid",
        requirement("absl-py"),
        "//tink:secret_key_access",
        "//tink:tink_python",
        "//tink/proto:tink_py_pb2",
        "//tink/testing:keyset_builder",
    ],
)

py_library(
    name = "_hybrid_key_templates",
    srcs = ["_hybrid_key_templates.py"],
    srcs_version = "PY3",
    deps = [
        "//tink/aead",
        "//tink/daead",
        "//tink/proto:common_py_pb2",
        "//tink/proto:ecies_aead_hkdf_py_pb2",
        "//tink/proto:hpke_py_pb2",
        "//tink/proto:tink_py_pb2",
    ],
)

py_test(
    name = "_hybrid_key_templates_test",
    srcs = ["_hybrid_key_templates_test.py"],
    srcs_version = "PY3",
    deps = [
        ":hybrid",
        requirement("absl-py"),
        "//tink/aead",
        "//tink/proto:common_py_pb2",
        "//tink/proto:ecies_aead_hkdf_py_pb2",
        "//tink/proto:hpke_py_pb2",
        "//tink/proto:tink_py_pb2",
    ],
)
